package design_pattern.decorator.demo02;

import java.util.Objects;

/**
 * @version 1.0.0
 * Created by cyd on 2022-06-06 12:35:03
 * @ClassName : design_pattern.decorator.demo02.Decorator
 * @Description : 类描述
 */
public abstract class Decorator implements Person{

    protected Person person;

    public void setPerson(Person person) {
        this.person = person;
    }

    public Person getPerson() {
        return person;
    }

    @Override
    public void wear() {
        if (!Objects.isNull(person)){
            person.wear();
        }
    }
}
